# Contributor: Grigory Kirillov <txgk@bk.ru>
# Maintainer: Jonas <3426-spameier@users.gitlab.alpinelinux.org>
pkgname=libigraph
pkgver=0.10.13
pkgrel=0
pkgdesc="Library for creating and manipulating graphs"
url="https://igraph.org"
# s390x: blocked by openmp
arch="all !s390x"
license="GPL-2.0-or-later"
# bison and flex are needed when building from commit
makedepends="
	arpack-dev
	cmake
	glpk-dev
	libxml2-dev
	openblas-dev
	plfit-dev
	samurai
	"
subpackages="$pkgname-dev"
source="https://github.com/igraph/igraph/releases/download/$pkgver/igraph-$pkgver.tar.gz"
builddir="$srcdir/igraph-$pkgver"

build() {
	# For building against master branch:
	#echo "$pkgver" > IGRAPH_VERSION

	cmake -B builddir -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=Release \
		-DBUILD_SHARED_LIBS=ON
	cmake --build builddir
}

check() {
	cmake --build builddir --target check
}

package() {
	DESTDIR="$pkgdir" cmake --install builddir
}

sha512sums="
2b6f5b219713c12114066c1a2a5a60d79665b77b27900c9cb06ab80e86088e96ef64a941fb4615e86833e60dfe7d9d4e13d850205391721e27acc6cc498da2fd  igraph-0.10.13.tar.gz
"
